using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
using TianShu.Domain.Entities;
using TianShu.MultiTenancy;
using TianShu.Domain.Entities.Auditing;
namespace Nb.FactoryAssistant.DAL.Abstracts.Entities
{
    /// <summary>
    /// 实体类：仓库
    /// </summary>
    [SugarTable("Wms_Warehouse")]
    public class WmsWarehouse : FullAuditedEntity<Guid>, IMultiTenant
    {

        ///<summary>
        ///<para>仓库编码</para>
        ///</summary>
        [SugarColumn(ColumnName = "Code", IsNullable = false, Length = 32, ColumnDescription = "仓库编码")]
        public virtual string Code { get; set; }

        ///<summary>
        ///<para>描述</para>
        ///</summary>
        [SugarColumn(ColumnName = "Description", IsNullable = true, Length = 256, ColumnDescription = "描述")]
        public virtual string Description { get; set; }

        ///<summary>
        ///<para>仓库名称</para>
        ///</summary>
        [SugarColumn(ColumnName = "Name", IsNullable = false, Length = 64, ColumnDescription = "仓库名称")]
        public virtual string Name { get; set; }

        ///<summary>
        ///<para>二维码</para>
        ///</summary>
        [SugarColumn(ColumnName = "QRCode", IsNullable = true, Length = 64, ColumnDescription = "二维码")]
        public virtual string QRCode { get; set; }

        ///<summary>
        ///<para>状态（0：启用，1：禁用）</para>
        ///</summary>
        [SugarColumn(ColumnName = "Status", IsNullable = false, ColumnDescription = "状态")]
        public virtual WmsWarehouseStatusEnum Status { get; set; }

        ///<summary>
        ///<para>租户id</para>
        ///</summary>
        [SugarColumn(ColumnName = "TenantId", IsNullable = true, Length = 36)]
        public virtual Guid? TenantId { get; set; }

        ///<summary>
        ///<para>仓库类型</para>
        ///</summary>
        [SugarColumn(ColumnName = "WarehouseTypeId", IsNullable = false, Length = 36, ColumnDescription = "仓库类型")]
        public virtual Guid WarehouseTypeId { get; set; }

        public WmsWarehouse()
        {
            Status = WmsWarehouseStatusEnum.Enable;
            QRCode = "";
        }
        public WmsWarehouse(string code, string description, string name, Guid warehouseTypeId)
        {
            Code = code;
            Description = description;
            Name = name;
            WarehouseTypeId = warehouseTypeId;
        }
        /// <summary>
        /// 设置qrcode
        /// </summary>
        /// <param name="qrcode"></param>
        public void SetQrCode(string qrcode)
        {
            QRCode = qrcode;
        }
    }
}
